﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DMHelper.Models;

namespace DMHelper.Models
{
    public class SkillsContainer
    {
        public NumericalField pointPerLevel = new NumericalField();
        public ReferenceNumericalField Level = new ReferenceNumericalField(new NumericalField());
        public ReferenceNumericalField armorPenalty = new ReferenceNumericalField(new NumericalField());

        private NumericalField _doubleArmorPenalty = new NumericalField();
        public NumericalField doubleArmorPenalty
        {
            get
            {
                _doubleArmorPenalty.Value = armorPenalty.Value;
                return _doubleArmorPenalty;
            }


        }

        private NumericalField _maxPointUnClass = new NumericalField();
        private NumericalField _maxPointClass = new NumericalField();

        public NumericalField maxPointUnClass
        {
            get
            {
                _maxPointUnClass.Value = (Level.Value + 3) / 2;
                    return _maxPointUnClass;
            }
        }

        public NumericalField maxPointClass
        {
            get
            {
                _maxPointClass.Value = (Level.Value + 3);
                return _maxPointClass;
            }
        }

        public Dictionary<String, SingleSkillContainer> listeSkill = new Dictionary<string, SingleSkillContainer>();
        public SingleSkillContainer Skill(String ID)
        {
            return listeSkill[ID];
        }

        public SkillsContainer(StatsContainer statReference, NumericalField playerlevel, NumericalField playerarmorPenalty)
        {
            Level = new ReferenceNumericalField(playerlevel);
            armorPenalty = new ReferenceNumericalField(playerarmorPenalty);
            listeSkill.Add("Appraise", new SingleSkillContainer("Appraise",false, true,statReference.ability("Int"),armorPenalty));
            listeSkill.Add("Balance", new SingleSkillContainer("Balance", true, true, statReference.ability("Dex"), armorPenalty));
            listeSkill.Add("Bluff", new SingleSkillContainer("Bluff", false, true, statReference.ability("Cha"), armorPenalty));
            listeSkill.Add("Climb", new SingleSkillContainer("Climb", true, true, statReference.ability("Str"), armorPenalty));
            listeSkill.Add("Concentration", new SingleSkillContainer("Concentration", false, true, statReference.ability("Con"), armorPenalty));
            listeSkill.Add("Decipher", new SingleSkillContainer("Decipher", false, false, statReference.ability("Int"), armorPenalty));
            listeSkill.Add("Diplomacy", new SingleSkillContainer("Diplomacy", false, true, statReference.ability("Cha"), armorPenalty));
            listeSkill.Add("Disable", new SingleSkillContainer("Disable device", false, false, statReference.ability("Int"), armorPenalty));
            listeSkill.Add("Disguise", new SingleSkillContainer("Disguise", false, true, statReference.ability("Cha"), armorPenalty));
            listeSkill.Add("Escape", new SingleSkillContainer("Escape", true, true, statReference.ability("Dex"), armorPenalty));
            listeSkill.Add("Forgery", new SingleSkillContainer("Forgery", false, true, statReference.ability("Int"), armorPenalty));
            listeSkill.Add("Gather", new SingleSkillContainer("Gather information", false, true, statReference.ability("Cha"), armorPenalty));
            listeSkill.Add("Handle", new SingleSkillContainer("Handle animal", false, false, statReference.ability("Cha"), armorPenalty));
            listeSkill.Add("Heal", new SingleSkillContainer("Heal", false, true, statReference.ability("Int"), armorPenalty));
            listeSkill.Add("Hide", new SingleSkillContainer("Hide", true, true, statReference.ability("Dex"), armorPenalty));
            listeSkill.Add("Intimidate", new SingleSkillContainer("Intimidate", false, true, statReference.ability("Cha"), armorPenalty));
            listeSkill.Add("Jump", new SingleSkillContainer("Jump", true, true, statReference.ability("Int"), armorPenalty));
            listeSkill.Add("Listen", new SingleSkillContainer("Listen", false, true, statReference.ability("Int"), armorPenalty));
            listeSkill.Add("Move", new SingleSkillContainer("Move silently", true, true, statReference.ability("Dex"), armorPenalty));
            listeSkill.Add("Open", new SingleSkillContainer("Open lock", false, false, statReference.ability("Dex"), armorPenalty));
            listeSkill.Add("Ride", new SingleSkillContainer("Ride", false, true, statReference.ability("Dex"), armorPenalty));
            listeSkill.Add("Search", new SingleSkillContainer("Search", false, true, statReference.ability("Int"), armorPenalty));
            listeSkill.Add("Sense", new SingleSkillContainer("Sense motive", false, true, statReference.ability("Int"), armorPenalty));
            listeSkill.Add("Sleight", new SingleSkillContainer("Sleight of hand", true, false, statReference.ability("Dex"), armorPenalty));
            listeSkill.Add("Spellcraft", new SingleSkillContainer("Spellcraft", false, false, statReference.ability("Int"), armorPenalty));
            listeSkill.Add("Spot", new SingleSkillContainer("Spot", false, true, statReference.ability("Int"), armorPenalty));
            listeSkill.Add("Survival", new SingleSkillContainer("Survival", false, true, statReference.ability("Int"), armorPenalty));
            listeSkill.Add("Swim", new SingleSkillContainer("Swim", true, true, statReference.ability("Str"), armorPenalty));
            listeSkill.Add("Tumble", new SingleSkillContainer("Tumble", true, true, statReference.ability("Dex"), armorPenalty));
            listeSkill.Add("Use_Magic", new SingleSkillContainer("Use Magic device", false, false, statReference.ability("Cha"), armorPenalty));
            listeSkill.Add("Use_Rope", new SingleSkillContainer("Use Rope", false, true, statReference.ability("Dex"), armorPenalty));
 

        }
    }
}